package Day7;

import java.util.Scanner;

public class TuTest {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        while (true){
            System.out.println("请输入你要计算的图型：1.圆  2.长方形  3.三角形  4.退出");
            int choose = input.nextInt();
            if (choose == 1) {
                Circle a = new Circle();
                System.out.println("请输入圆的半径：");
                double r = input.nextDouble();
                a.setA(input.nextDouble());
                a.area();
                a.perimeter();
            } else if (choose == 2) {
                Oblong b = new Oblong();
                System.out.println("请输入长方形的长和宽：");
                b.setA(input.nextDouble());
                b.setB(input.nextDouble());
                b.area();
                b.perimeter();
            } else if (choose == 3) {
                Triangle c = new Triangle();
                System.out.println("请输入三角形的三条边长：");
                c.setA(input.nextDouble());
                c.setB(input.nextDouble());
                c.setC(input.nextDouble());
                c.area();
                c.perimeter();
            }else {
                break;
            }
        }

    }
}
